﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Toolkit.Web.Infastructure;

namespace Toolkit.Web.ViewComponents.DataGrid
{
    public sealed class DataGridMenu<T> where T : class
    {
        public DataGridMenu(DataGrid<T> dataGrid)
        {
            if (dataGrid == null)
            {
                throw new ArgumentNullException();
            }

            DataGrid = dataGrid;
            HtmlAttributes = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
            UniversalSectionTemplates = new List<HtmlTemplate<IReadOnlyDataGrid<T>>>();
            ColumnSpecificSectionTemplates = new Dictionary<Guid, IList<HtmlTemplate<IReadOnlyDataGridColumn<T>>>>();
        }

        public DataGrid<T> DataGrid
        {
            get;
            private set;
        }

        public IDictionary<string, object> HtmlAttributes
        {
            get;
            set;
        }

        public IList<HtmlTemplate<IReadOnlyDataGrid<T>>> UniversalSectionTemplates
        {
            get;
            set;
        }

        public IDictionary<Guid, IList<HtmlTemplate<IReadOnlyDataGridColumn<T>>>> ColumnSpecificSectionTemplates
        {
            get;
            set;
        }
    }
}
